package com.ssm.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ssm.entity.MBaseCustomersPO;
import com.ssm.mapper.MBaseCustomersMapper;
import com.ssm.service.MBaseCustomersService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 * (M_BASE_CUSTOMERS)表控制层
 *
 * @author xxxxx
 */
@RestController
@RequestMapping("/m_base_customers")
public class MBaseCustomersPOController {
  /**
   * 服务对象
   */
  @Autowired
  private MBaseCustomersService mBaseCustomersPOService;
  /**
   * 通过主键查询单条数据
   *
   * @param id 主键
   * @return 单条数据
   */
  @GetMapping("/selectOne")
  public List<MBaseCustomersPO> selectOne(Integer id) {
    IPage<MBaseCustomersPO> mBaseCustomersPOIPage = new Page<>(1, 1);
    System.out.println("mBaseCustomersPOIPage = " + mBaseCustomersPOIPage);
    System.out.println("id = " + id);
    IPage<MBaseCustomersPO> page = new Page<>(1, 5);
    //    return mBaseCustomersPOService.iPageSelect(page);
    return mBaseCustomersPOService.getPageTest(page);
    //    return mBaseCustomersMapper.getPageTest();
    //    MBaseCustomersPO mBaseCustomersPOs = new MBaseCustomersPO();
    //    mBaseCustomersPOs.setOutid("");
    //    mBaseCustomersPOs.setEcode("");
    //    mBaseCustomersPOs.setId(new BigDecimal("0"));
    //    mBaseCustomersPOs.setName("");
    //    mBaseCustomersPOs.setSex("");
    //    mBaseCustomersPOs.setCertificateid(new BigDecimal("0"));
    //    mBaseCustomersPOs.setIdcardno("");
    //    mBaseCustomersPOs.setDpcode("");
    //    mBaseCustomersPOs.setCustsf(new BigDecimal("0"));
    //    mBaseCustomersPOs.setRegstartyear(new BigDecimal("0"));
    //    mBaseCustomersPOs.setXz(new BigDecimal("0"));
    //    mBaseCustomersPOs.setNousedate(new Date());
    //    mBaseCustomersPOs.setUpdateflag(new BigDecimal("0"));
    //    mBaseCustomersPOs.setUpdatedt(new Date());
    //    mBaseCustomersPOs.setDowndt(new Date());
    //    mBaseCustomersPOs.setCardtype(new BigDecimal("0"));
    //    mBaseCustomersPOs.setCountry("");
    //    mBaseCustomersPOs.setNation("");
    //    mBaseCustomersPOs.setTelephone("");
    //    mBaseCustomersPOs.setBirthday(new Date());
    //    mBaseCustomersPOs.setAddress("");
    //    mBaseCustomersPOs.setEmail("");
    //    mBaseCustomersPOs.setMedicaltype(new BigDecimal("0"));
    //    mBaseCustomersPOs.setBankcardno("");
    //    System.out.println("mBaseCustomersPOs = " + mBaseCustomersPOs);
    //    int i = mBaseCustomersPOService.insertOrUpdate(mBaseCustomersPOs);
    //    return i;
    //    List<Integer> idList = new ArrayList<>();
    //    idList.add(125251);
    //    return mBaseCustomersPOService.listByIds(idList);
    //    Wrapper<MBaseCustomersPO> wrapper = new QueryWrapper<>();
    //    return mBaseCustomersPOService.list(wrapper);
  }
  @ApiOperation(value = "查询老师")
  @GetMapping("/list")
  public List<MBaseCustomersPO> list() {
    Wrapper<MBaseCustomersPO> wrapper = new QueryWrapper<>();
    return mBaseCustomersPOService.list(wrapper);
  }
}
